package isquirrel;

import static org.junit.Assert.*;

import isquirrel.beans.YouTubeVideo;

import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Vector;

import org.junit.Test;

public class YouTubeAPITest {

	@Test
	public void testGetVideosByKeywords() {

		System.out.println("****** TESTING: -OR- KEYWORD SEARCH ******");

		YouTubeAPI api = new YouTubeAPI();
		
		ArrayList<String> keywords = new ArrayList<String>();
		keywords.add("Football");
		keywords.add("Soccer");
		keywords.add("Basketball");
		keywords.add("Swimming");
		keywords.add("Travelling");
		keywords.add("Coffee");
		keywords.add("Cars");
		keywords.add("Michael Jackson");
		keywords.add("Books");
		keywords.add("Food");
		keywords.add("Chinese");
			
		try {
			Vector<YouTubeVideo> vids = api.getVideosByKeywords(keywords,YouTubeAPI.OR_KEYWORDS,1);
			assertNotNull(vids);
			int index = 1;
			for (YouTubeVideo vid: vids){
				System.out.println("VIDEO INDEX: " + index + " -- " + vid.toString());
				++index;
			}
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		System.out.println("****** END -OR- KEYWORD TESTING ******");
		
	}

}
